import 'package:flutter/material.dart';
import 'package:flutter_deer/account/iview/flowing_water_iview.dart';
import 'package:flutter_deer/account/models/flowing_water_entity.dart';
import 'package:flutter_deer/mvp/base_page_presenter.dart';
import 'package:flutter_deer/net/base_entity.dart';
import 'package:flutter_deer/net/dio_utils.dart';
import 'package:flutter_deer/net/http_api.dart';


class FlowingWaterPagePresenter extends BasePagePresenter<FlowingWaterIMvpView> {

  @override
  void initState() {
    WidgetsBinding.instance.addPostFrameCallback((_) {
      requestNetwork<BaseEntity<List<FlowingWaterEntity>>>(Method.get,
          url: HttpApi.scoreFlowingWaterList,
          onSuccess: (data) {
            List<FlowingWaterEntity> flowingWaterList = data?.data ?? [];
            view.setFlowingWaterList(flowingWaterList);
          },
          onError: (code, msg) {

          }
      );
    });
  }
}